from sqlalchemy import Column, text, TEXT, JSON
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
from field_types.base_types import String
from models.base_model import Base


class Data(Base):
    """
    数据表
    """
    __tablename__ = 'data'
    data_id = Column(INTEGER(11), primary_key=True)
    guid = Column(String(40, 'utf8mb4_unicode_ci'))
    project_id = Column(INTEGER(11))
    path = Column(String(256, 'utf8mb4_unicode_ci'))
    path_2 = Column(String(256, 'utf8mb4_unicode_ci'))
    size = Column(String(256, 'utf8mb4_unicode_ci'))
    md5 = Column(String(256, 'utf8mb4_unicode_ci'))
    set = Column(TINYINT(1), server_default=text("'0'"))
    conform = Column(TINYINT(1), server_default=text("'1'"))
    create_time = Column(INTEGER(11))
    create_user_id = Column(INTEGER(11))
    last_update_time = Column(INTEGER(11))
    last_update_user_id = Column(INTEGER(11))
    is_delete = Column(TINYINT(1), server_default=text("'0'"))